package com.itheima.a14waitandnotify;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends Thread{
    ArrayBlockingQueue<String> queen;

    public Foodie(ArrayBlockingQueue<String> queen) {
        this.queen = queen;
    }

    @Override
    public void run() {
        while (true){
            //不断从阻塞队列获取面条
            try {
                String food = queen.take();
                System.out.println(food);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
